package com.xbongbong.pro.domain.dao;

import com.xbongbong.pro.domain.entity.AiAssistantHistoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @description: 智能助手历史记录
 * @Author: hongxiao
 * @date: 2019-05-09 21:24
 * @since v1.0
 */
@Repository
@Mapper
public interface AiAssistantHistoryDao {
    Integer insert(AiAssistantHistoryEntity aiAssistantHistoryEntity);

    Integer update(AiAssistantHistoryEntity aiAssistantHistoryEntity);

    void insertBatch(List<AiAssistantHistoryEntity> entityList);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    AiAssistantHistoryEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    List<AiAssistantHistoryEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    /**
     * 批量失效
     */
    void invalidBatch(@Param("corpid") String corpid, @Param("idIn") List<Long> idIn);
    /**
     * 批量更新（triggerNum，triggerInvalid，updateTime，timeAndExecutor）
     */
    void updateBatch(@Param("list") List<AiAssistantHistoryEntity> entityList, @Param("corpid") String corpid);
}
